package com.galen.wxRead.utils;

import java.util.Random;

/**
 * @author zbm
 * @date 2019-05-29
 */
public class MacUtil {

    private static final String SEPARATOR_OF_MAC = ":";

    /**
     * 生成随机mac
     *
     * @return mac
     */
    public static String randomMac4Qemu() {
        Random random = new Random();
        String[] mac = {
                String.format("%02x", 0x52),
                String.format("%02x", 0x54),
                String.format("%02x", 0x00),
                String.format("%02x", random.nextInt(0xff)),
                String.format("%02x", random.nextInt(0xff)),
                String.format("%02x", random.nextInt(0xff))
        };
        return String.join(SEPARATOR_OF_MAC, mac);
    }
}
